﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using mmoss.Tools.Encryption;

namespace mmoss.Tools
{
    public class Encrypt
    {
        public static string ToHash(string sOriginal)
        {
            Hash h = new Hash(Encryption.Hash.Provider.SHA1);
            Data d = new Data(sOriginal);
            //salt
            Data salt = new Data("NaCl");
            h.Calculate(d, salt);
            return h.Value.ToString();
        }
    }
    public class Decrypt
    {
        public static string ToText(string sHashed)
        {
            Hash h = new Hash(Encryption.Hash.Provider.SHA1);
            Data d = new Data(sHashed);
            //salt
            Data salt = new Data("NaCl");
            h.Calculate(d, salt);
            return h.Value.ToString();
        }
    }
}
